package com.renjiyue.dao;

import com.renjiyue.pojo.User;
import org.mybatis.spring.support.SqlSessionDaoSupport;

import java.util.List;

public class UserMapperImpl extends SqlSessionDaoSupport implements UserMapper{
    //增加一些事件

    @Override
    public List<User> selectUser() {
        //User user = new User(2,"xiaoming","123456");
        UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
        //mapper.addUser(user);
        //mapper.deleteUser(2);
        return mapper.selectUser();
    }

    //新增
    @Override
    public int addUser(User user) {
        UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
        return mapper.addUser(user);
    }

    //删除

    @Override
    public int deleteUser(int id) {
        UserMapper mapper = getSqlSession().getMapper(UserMapper.class);
        return mapper.deleteUser(2);
    }
}
